<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>打印星星</title>
    <script>
        var sum = prompt('请输入你想打印多少星星');
        var str = '';
        for (var i = 0; i < sum; i++) {
            str += '⭐';
        }
        alert(str);
    </script>
</head>

<body>

</body>

</html>